{% extends "../../theme/bage.html" %}
{% block typebody %}
<div class="mtop">
    <ul class="breadcrumb">
       <li>{{ _('Current location') }}: <a href="{% module site_url() %}">{{ _('Home') }}</a></li>
        <li class="active">{{ _('Entity Download List') }}</li>
    </ul>
</div>
<div class="panel panel-black">
    <div class="panel-heading"><b>{{ _('Entity Download List') }}</b></div>
    <div class="panel-body">
        <table class="table table-bordered">
            <tr>
                <th>{{ _('Serial number') }}</th>
                <th>{{ _('Entity') }}</th>

                <th>{{ _('User') }}</th>
                <th>{{ _('User IP') }}</th>
                <th>{{ _('Download Time') }}</th>


            </tr>
            {% set ii = 1 %}
            {% for x in imgs %}
            <tr>
                <td>{{ ii }}</td>


                 <td>
                 <span id="entry_img_{{ii}}" style="display: none; float: left;padding-right: 10px"
                              class="glyphicon glyphicon-picture"></span>
                        <span id="entry_file_{{ii}}" style="display: none; float: left;padding-right: 10px"
                              class="glyphicon glyphicon-file"></span>
                        <span id="entry_url_{{ii}}" style="display: none; float: left;padding-right: 10px"
                              class="glyphicon glyphicon-link"></span>
                 {% if x.entity_path.startswith('http://') or x.entity_path.startswith('https://')%}

                    <a href="{{x.entity_path}}" target="_blank" title="{{x.entity_path}}">

                        {{x.entity_path}}
                    </a>
                    {% elif x.entity_path.startswith('/static/')%}
                        <a href="{% module site_url() %}{{x.entity_path}}" target="_blank"
                       title="{% module site_url() %}{{x.entity_path}}">
                        {% module site_url() %}{{x.entity_path}}
                        </a>

                    {% else %}
                    <a href="{% module site_url() %}{{ static_url('upload/') }}{{x.entity_path}}" target="_blank"
                       title="{% module site_url() %}{{ static_url('upload/') }}{{x.entity_path}}">
                        {% module site_url() %}{{ static_url('upload/') }}{{x.entity_path}}
                    </a>
                    {% end %}




                </td>




                <td>{% module user_name_by_id(x.user_id)%}</td>
                <td>{{ x.user_ip }}</td>
                 <td>
                    {{ datetime.datetime.fromtimestamp(x.timestamp).strftime('%Y-%m-%d %H:%M:%S')  }}
                </td>
            </tr>
            {% set ii = ii +1 %}
            {% end %}
        </table>

        {% module entity_download_list(kwd['current_page']) %}
        <br>
    </div>
</div>
{% end %}

